UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SjIA0WexxeOY6F8ZLfxm7b0W+arOGo2VKqWfwMcF4Jc='
WHERE
key_id = '26d4fdd458d098838366ab6ead3e753f89d452b216f85c621a58c973ddfc9ddd'
AND (
token = 'SjIA0WexxeOY6F8ZLfxm7b0W+arOGo2VKqWfwMcF4Jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)