UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3OE2ZrPt1/onJBkavOvyUkX4NeA+/i+6SCpvDWE6YJo=' 
WHERE 
  key_id = '83e0d17ca9f41e51742627d1d9a88470b0f44d6ad1fabe308e2411982cfd2658' 
  AND (
    token = '3OE2ZrPt1/onJBkavOvyUkX4NeA+/i+6SCpvDWE6YJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037