UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xFXtFhnx+pPZRLlUR4DspZjeq/O3k2gTv+mPM59gobE=' 
WHERE 
  key_id = '3613cdc72cca130b91563cbd0eea989bb274352b1c52fc42be7bd10f6d56a3fe' 
  AND (
    token = 'xFXtFhnx+pPZRLlUR4DspZjeq/O3k2gTv+mPM59gobE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038