UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TrdgquND7OJULnc0WvXh2X6Q46bhIQAy8544xVb/NY='
WHERE
key_id = '2c98737618c882102ce50ca640508bca24ab4286aae4f4a8fadb0cae23c77a4f'
AND (
token = '2TrdgquND7OJULnc0WvXh2X6Q46bhIQAy8544xVb/NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)