UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvT+v2ppPeGKoGn+PyAqRZ2C3N+zdYyceglDyXSCUNA=' 
WHERE 
  key_id = '9940d2a197cf298e3b085be9b28648e3d8638e0dcd5ca7eb4ed4837dd6215f47' 
  AND (
    token = 'EvT+v2ppPeGKoGn+PyAqRZ2C3N+zdYyceglDyXSCUNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028