UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5PRuJxH8vCPpTc5vSeZFqg4K+f8Ve5aoEyuHcPrrZgk='
WHERE
key_id = '23af36faad53216c57009561ece9f4ace838ef6bca4d45ecc95c6da40b70cb7f'
AND (
token = '5PRuJxH8vCPpTc5vSeZFqg4K+f8Ve5aoEyuHcPrrZgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)