UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tWrOmBA4tXNygTzs29AESPiTJSEKXklNzClB6zLIuW8='
WHERE
key_id = '6a95da706b1a64c9d4e57ee6a6ac39fd5d59845aa8996716059fc3781b1b6f38'
AND (
token = 'tWrOmBA4tXNygTzs29AESPiTJSEKXklNzClB6zLIuW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)