UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PXaWKRTWoNjOhAx1HzVbTa8X39SdF3MSKp67TkTXi0s='
WHERE
key_id = '97667c60379e7f56b8a202a9ac78273b7aa13020b8304dfc11ad22d5b35b1efc'
AND (
token = 'PXaWKRTWoNjOhAx1HzVbTa8X39SdF3MSKp67TkTXi0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)