UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2bqKIsvOeVxSjiYcD6pjE6S0xkYnsJVMakxDBa+wVh8='
WHERE
key_id = 'd1e22caa888c74515a8c41ec2da2bad8a85f9b5f1e8bfa6e4363916026946172'
AND (
token = '2bqKIsvOeVxSjiYcD6pjE6S0xkYnsJVMakxDBa+wVh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)