UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dMFG0LH8UkNmxo552flkhpzY9Rfj1LTmTESQChHQxLQ='
WHERE
key_id = '8de80c0ccdeaa2c8462f6af4a4389b7cbc3961b49074af09bb02344827a62c1c'
AND (
token = 'dMFG0LH8UkNmxo552flkhpzY9Rfj1LTmTESQChHQxLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)