UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fcu8q8Th7PapnbJm91gQt6KLvYfDk8iX7R5ChsNxrJM='
WHERE
key_id = 'd6895cee721968b7f9ecc69833a8de3e25451446095808e42fe59531ee7ebe16'
AND (
token = 'fcu8q8Th7PapnbJm91gQt6KLvYfDk8iX7R5ChsNxrJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)