UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MdlNEKCGQkPNOSLn6qUD336FmC689Xq6an2QZkAO2WQ=' 
WHERE 
  key_id = '89f90a86213a3b8bfdccc4d71a4cc97e1cb6b0ef3fc623ff21fd67e74c56e27f' 
  AND (
    token = 'MdlNEKCGQkPNOSLn6qUD336FmC689Xq6an2QZkAO2WQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031