UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6VtkCr7hqA3NfcvSwIDZ+gJduSpqU0gy9kUkEASPP/Y=' 
WHERE 
  key_id = '6a13fc72f0f75b196b5098160dbf4f015070c929101328af4110c64e29377b58' 
  AND (
    token = '6VtkCr7hqA3NfcvSwIDZ+gJduSpqU0gy9kUkEASPP/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028