UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8o19p1JFGym3uBe2inbSrVJaPxtMdGKXKQ34tfQqdLE=' 
WHERE 
  key_id = '33d5d28a7f12c89819b75fd61d75a144ea25240d784e68a28d932b018c0d46c7' 
  AND (
    token = '8o19p1JFGym3uBe2inbSrVJaPxtMdGKXKQ34tfQqdLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031