UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MNxD8U3kIeYgkpBzmKkB9/jTJYO3ZB1PC0QKfAnZ7k='
WHERE
key_id = '0f7465753492f43c110812659be99110bf6edc6c56846a766fcbc7d5859773d0'
AND (
token = '7MNxD8U3kIeYgkpBzmKkB9/jTJYO3ZB1PC0QKfAnZ7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)