UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HuLXMcHb42u7At0sKL4cBxPPUgEWEP4VSULNTOlf+Ao=' 
WHERE 
  key_id = '50313d4b2b83c52ed615b7ffac9aee7eeec9f2cad24bd2c7acf807dd83f52e21' 
  AND (
    token = 'HuLXMcHb42u7At0sKL4cBxPPUgEWEP4VSULNTOlf+Ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026