UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Mcwm0hKctEnb02VOXZYxVl8/Ef7ARNLb8QxtojUnhQ='
WHERE
key_id = '0aff8115c9b18b4802d98bec273c2c2df3e3be6f160db8eed1ee24293ea2ba84'
AND (
token = '7Mcwm0hKctEnb02VOXZYxVl8/Ef7ARNLb8QxtojUnhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)