UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RlovN5OK6rpq/qUbW9WXI8GTmfAQ7IY0Mn++qFTbwUE='
WHERE
key_id = '48f21ac088f0a2540afc7c75180c7adb6473fa45e929af64c62fdf8a5ebbda25'
AND (
token = 'RlovN5OK6rpq/qUbW9WXI8GTmfAQ7IY0Mn++qFTbwUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)