UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BhVYJlyt1NDRlUIZoV40UqAR2FfTrUVFB2+yQ0V1/uY=' 
WHERE 
  key_id = '86e70734f63e6bddf9aff047c28b72f1ac58d80d274180c416b8ffe028162531' 
  AND (
    token = 'BhVYJlyt1NDRlUIZoV40UqAR2FfTrUVFB2+yQ0V1/uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033