UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F4et/zRniHdv0uYk41JeFXujH5PZBGGcMvWw+CL+si0=' 
WHERE 
  key_id = 'b5b2a215b7c51f2969da59caf46787cc94685a8e5de411b3e266ac3101f6036a' 
  AND (
    token = 'F4et/zRniHdv0uYk41JeFXujH5PZBGGcMvWw+CL+si0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042