UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bckYO3TJx+HRvpkJ6wK+Tuk6AalMJJzJwNlZwc3BWP4='
WHERE
key_id = '9825f370b5c9d40ce38d5d8e76391b65987b295bf47971eaa3fc693e16de4960'
AND (
token = 'bckYO3TJx+HRvpkJ6wK+Tuk6AalMJJzJwNlZwc3BWP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)