UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ZS584jQaEuhfZNbe6O+LYSEXKW4VBjKbXTnEs6dZYo='
WHERE
key_id = 'd35a37268fb5f7aaf66cdccc18a411d0534c54adc32f70072a1cf3b85b93770c'
AND (
token = '7ZS584jQaEuhfZNbe6O+LYSEXKW4VBjKbXTnEs6dZYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)