UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nhyo8nvhfWadn6qSCB6wD9oJCJmMkSLR+4uY51m2onQ=' 
WHERE 
  key_id = '136906b8f26c385c3ea79c10abfdf059d7b21ff5619361e38011eba5dc56356b' 
  AND (
    token = 'nhyo8nvhfWadn6qSCB6wD9oJCJmMkSLR+4uY51m2onQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030