UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6nw5YehDxlfP8n2635IVbAFnchqgUB++YTrgMLOH7ZE=' 
WHERE 
  key_id = '3756873c9679116c19505fffec78318ec363ce6a2554079941b5f1c8eb3a01d2' 
  AND (
    token = '6nw5YehDxlfP8n2635IVbAFnchqgUB++YTrgMLOH7ZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030