UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qpCF18k3h7GRL+VkTmJgx17c4CBLY2311EgoTYeG2G8='
WHERE
key_id = '88665192e73a285fca7efabc70a83af4a3387163c24070bfef1ae88f1e3a4dcb'
AND (
token = 'qpCF18k3h7GRL+VkTmJgx17c4CBLY2311EgoTYeG2G8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)