UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nupie0Hx5UHJhBVWIVO/p1tOX4lQanFhHzG0RzlNZDU='
WHERE
key_id = 'ea5b00e64691e32fbe23f1762505ea06b48118496e5466bb2db75d42eea2e176'
AND (
token = 'nupie0Hx5UHJhBVWIVO/p1tOX4lQanFhHzG0RzlNZDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)