UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1UbtrFVjEU6i5jbBtpwK3kBz2Qe7/HpBepIB3QH+i68=' 
WHERE 
  key_id = '04735a1a9c31ce7b6f6b8c0160a4accbbe05f07c946501ead2850f53b726d0ec' 
  AND (
    token = '1UbtrFVjEU6i5jbBtpwK3kBz2Qe7/HpBepIB3QH+i68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042