UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OZgPEaG5GxmjvI5VqKqyXOyTHdJOTC7Zo0vp168oSNA='
WHERE
key_id = '9cbf57ea3913cade6a1e97dc4112ead3741199709d053779f93125e3dbafa942'
AND (
token = 'OZgPEaG5GxmjvI5VqKqyXOyTHdJOTC7Zo0vp168oSNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)