UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VO3A+c8Hb/FcIv3J0JteHWdTvT+CTM3yxjyqEbmpa8k='
WHERE
key_id = 'ec7dc03efb64101cd06b48bb9b0cd6c87303aad2c967a7ced963f85875c2a961'
AND (
token = 'VO3A+c8Hb/FcIv3J0JteHWdTvT+CTM3yxjyqEbmpa8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)