UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkQ7LlEIep5meFFWIUqhDPrQZxzciKOM1Uv4SUROwzA=' 
WHERE 
  key_id = '341c510d420287b0922771b5f7126d1399a42a480a85dadcc20fd81ae9ce6a8c' 
  AND (
    token = 'hkQ7LlEIep5meFFWIUqhDPrQZxzciKOM1Uv4SUROwzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015