UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'phmmH0kLSqLqOPkhLVLm03sshed7gkMw8KjN4Vi8pdo='
WHERE
key_id = '678a586967856212134fcc9a960ff01285e7e6802b0578904cef280f23e1d03e'
AND (
token = 'phmmH0kLSqLqOPkhLVLm03sshed7gkMw8KjN4Vi8pdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)