UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2iqxez8zWWWyEiHZ3fD68vTx2UOuqqrMQxrbH3XYa5M='
WHERE
key_id = '7eb5060eb6f8e14944047b8bef71dc03aec9d56d513941da8d5c0d032ff5905e'
AND (
token = '2iqxez8zWWWyEiHZ3fD68vTx2UOuqqrMQxrbH3XYa5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)