UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tjEVY5Lb06xflDEctG8dv7/BE1LNWehSpuZena7JsiI=' 
WHERE 
  key_id = '71b176df965997aa5d66eed0e0a69028d45f108817806b1e69a6dd7dae53ebaa' 
  AND (
    token = 'tjEVY5Lb06xflDEctG8dv7/BE1LNWehSpuZena7JsiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070