UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HsEVWyzUKnxljkNZaSqudEBMmOVfJXEkDx92UBHQMqU=' 
WHERE 
  key_id = '0a7867ff239f4398bdccacb0ed3820c4592d5ffa6d3b1816190a1eaf4c09d133' 
  AND (
    token = 'HsEVWyzUKnxljkNZaSqudEBMmOVfJXEkDx92UBHQMqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031