UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NvQFc4n9mUmGWVpQdmVHiivzqxwmQcDp+emlB7kr3U4='
WHERE
key_id = '15adc141b4705b72868b3a2a6ea69d07e248a8a4641867dcb03d0e5d621438c4'
AND (
token = 'NvQFc4n9mUmGWVpQdmVHiivzqxwmQcDp+emlB7kr3U4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)