UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fYeu+qZjc+BzRcuzm9h2sjdJVeboMoHr7KpwRjApUKE='
WHERE
key_id = 'a381eaf886326b119b30ef48f294fafd21146eadd7ed3a452f6d0dbbdba6cf65'
AND (
token = 'fYeu+qZjc+BzRcuzm9h2sjdJVeboMoHr7KpwRjApUKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)