UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vl7p6Z/hX2BgxbvmP8rZaRDjRGnSCGaMR5TeOVcnstI='
WHERE
key_id = '4171cf6c99f00e28afbecf43a3fa5aa0af1dac05a0d8644e83d596115f0f02f6'
AND (
token = 'Vl7p6Z/hX2BgxbvmP8rZaRDjRGnSCGaMR5TeOVcnstI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)