UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rL5G1cEzca7QkTgLmU9RF4CKp+JEObtZcurbF7+IqC0='
WHERE
key_id = 'cd6f70b70101ffbb6874143ae4363beafea493417c03bcbbe4580e54074f4837'
AND (
token = 'rL5G1cEzca7QkTgLmU9RF4CKp+JEObtZcurbF7+IqC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)