UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0QMSQf2vo3CtIQR7jpiPhbXfi0etmqTqTQW96bpqMbU='
WHERE
key_id = '940513a42e2c42e43e8fe2b433536c713090e3f7ff2b9c41fb4daebb92f35fe7'
AND (
token = '0QMSQf2vo3CtIQR7jpiPhbXfi0etmqTqTQW96bpqMbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)