UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37UCE+Wnj5ruGHgoZmctZNyCYL/iOWDmfoEPE4xjhq0='
WHERE
key_id = 'b856b49fb15620e2630521f32e6208379080f74e704a62657afc521e4157f625'
AND (
token = '37UCE+Wnj5ruGHgoZmctZNyCYL/iOWDmfoEPE4xjhq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)